1. Technical Field
The present invention relates to event handling in compositional applications.
2. Discussion of the Related Art
Automatic Application Composition Using Planning
Automated planning methods can be used to create composite applications in compositional architectures, such as web services, and stream processing. The applications are processing graphs composed of smaller modular components, such as service invocations, or other (smaller) processing graphs.
In many scenarios, the components are service invocations (such as web service invocations or invocation of a method of a Java class), and can be described in terms of their data effects and preconditions. In particular, we assume that a description (such as Web Services Description Language (WSDL) or Java object code with optional metadata annotations) of each service specifies the input requirements of the service (such as data type, semantics, access control labels, etc.). We refer to these input requirements as preconditions of service invocation, or simply preconditions. The description also specifies the effects of the service, describing the outputs of the service, including information such as data type, semantics, etc. In general, a service description may describe outputs as a function of inputs, so that the description of the output can only be fully determined once the specific inputs of the service have been determined. Note that in practical implementations the invocations can be synchronous, such as subroutine or Remote Procedure Call (RPC) calls, or asynchronous, such as asynchronous procedure calls or message exchange or message flow.
Under these assumptions, an automated planner can then be used to automatically assemble processing graphs based on a user-provided description of the desired output of the application. The descriptions of the components are provided to the planner in the form of a domain description. The planner can also take into account the specification of available primal inputs to the processing graphs, if not all inputs are available for a particular planning request.
The planner composes processing graphs by connecting components, starting from the primal inputs. It evaluates possible combinations of components, by computing descriptions of component outputs, and comparing them to preconditions of components connected to the output. More than one component input can be connected to one component output or one primal input. Logically, this amounts to sending multiple copies of data produced by the component output, with one copy sent to each of the inputs. In practical implementation, these do not have to be copies, and it is possible to pass data by reference instead of by value. The process terminates when an output of a component (or a set of outputs taken together) satisfy the conditions specified in the user requirement. Note that all conditions are evaluated at plan time, before any applications are deployed or executed.
If multiple alternative compositional architectures can be constructed and shown to satisfy the same request, the planner may use heuristics and utility functions to rank the alternatives and select one or several preferred compositions.
The application, i.e., the processing graph, once composed, is deployed in an execution environment and can be executed.
Examples of a planner and an execution environment are described in Zhen Liu, Anand Ranganathan and Anton Riabov, “A Planning Approach for Message-Oriented Semantic Web Service Composition”, in AAAI-2007.
Similar work has been done in contexts of stream processing, for example, in Stream Processing Core described in Navendu Jain, Lisa Amini, Henrique Andrade, Richard King, Yoonho Park, Philippe Selo and Chitra Venkatramani, “Design, Implementation, and Evaluation of the Linear Road Benchmark on the Stream Processing Core”, Proceedings of ACM SIGMOD 2006, as well as in Web Services and Grid Computing.
There are two main execution patterns that can be implemented by execution environments. While in web services, the execution of component services in the processing graph takes place when the composed application, i.e., the processing graph, is invoked, and becomes inactive after processing the service invocation request. In stream processing the processing graph begins a continuous processing of streaming data after it is deployed, and components of the processing graph remain active while the graph is processing data.
Commonly assigned U.S. application Ser. No. 11/970,262, filed Jan. 7, 2008 and commonly assigned U.S. application Ser. No. 11/971,068, filed Jan. 8, 2008 describe a system for automatic software assembly, which makes use of automated planning to assemble and configure software components. In that system, the components are assembled into an application in response to a user request that is represented as a set of tags.
Event Notification
Event processing and event and notification systems, such as JMS (Java Message Service) define a common design pattern used in software engineering. Event systems are generally used when one software component needs to be notified of changes in other components. The system allows the interested component to subscribe to events, and provides notification to subscribed components when events occur. Similarly, in database management systems, such as IBM DB2, triggers can be defined in order to react to changes in the data.
For example, in the execution environment described above, any active component of a deployed processing graph can be a source or a subscriber of an event.
Replanning Based on Events
In prior work, especially in the area of robotics, where planning is used, planning has been combined with event processing to react to events by generating new plans. For example, see A. Stentz, “The Focused D* Algorithm for Real-Time Replanning” (IJCAI-1995).
In view of the above, in compositional applications, for example in the processing graphs described above, often no single component has access to interfaces and/or information required to handle events originating in this or other components correctly. The components themselves are designed to be reusable in multiple applications, but event handling procedures differ between applications. Hence, the execution environment becomes responsible for reacting to events. In general, this requires providing one or several event handling procedures together with the processing graph.